<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML5语义标签应用示例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
        }
        
        /* 布局容器 */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        
        /* 头部样式 */
        header {
            background: linear-gradient(135deg, #2c3e50, #3498db);
            color: white;
            padding: 40px 30px;
            text-align: center;
        }
        
        h1 {
            font-size: 2.8rem;
            margin-bottom: 15px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }
        
        .subtitle {
            font-size: 1.3rem;
            opacity: 0.9;
            font-weight: 300;
        }
        
        /* 导航样式 */
        nav {
            background: #34495e;
            padding: 15px 0;
        }
        
        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        nav a {
            color: white;
            text-decoration: none;
            padding: 12px 25px;
            margin: 0 10px;
            border-radius: 5px;
            transition: all 0.3s ease;
            font-weight: 500;
        }
        
        nav a:hover {
            background: rgba(52, 152, 219, 0.8);
            transform: translateY(-2px);
        }
        
        /* 主要内容区域 */
        main {
            flex: 1;
            display: flex;
            padding: 30px;
            gap: 30px;
        }
        
        /* 文章区域 */
        article {
            flex: 3;
            background: #f8f9fa;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        }
        
        section {
            margin-bottom: 40px;
            padding: 25px;
            background: white;
            border-radius: 8px;
            border-left: 5px solid #3498db;
        }
        
        h2 {
            color: #2c3e50;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #ecf0f1;
            font-size: 2rem;
        }
        
        h3 {
            color: #3498db;
            margin: 20px 0 15px;
            font-size: 1.5rem;
        }
        
        /* 侧边栏 */
        aside {
            flex: 1;
            background: #f8f9fa;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        }
        
        .sidebar-widget {
            background: white;
            padding: 20px;
            margin-bottom: 25px;
            border-radius: 8px;
            border-left: 5px solid #e74c3c;
        }
        
        /* 图例和图片 */
        figure {
            margin: 20px 0;
            text-align: center;
        }
        
        .semantic-image {
            width: 100%;
            max-width: 600px;
            height: 300px;
            background: linear-gradient(135deg, #3498db, #9b59b6);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
            margin: 0 auto;
        }
        
        figcaption {
            margin-top: 10px;
            color: #7f8c8d;
            font-style: italic;
        }
        
        /* 页脚 */
        footer {
            background: #2c3e50;
            color: #ecf0f1;
            padding: 40px 30px;
            text-align: center;
            margin-top: auto;
        }
        
        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 30px;
        }
        
        .footer-section {
            flex: 1;
            min-width: 250px;
        }
        
        .footer-section h3 {
            color: #3498db;
            margin-bottom: 20px;
            font-size: 1.3rem;
        }
        
        .footer-bottom {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #34495e;
        }
        
        /* 代码块样式 */
        .code-block {
            background: #2c3e50;
            color: #ecf0f1;
            padding: 20px;
            border-radius: 8px;
            margin: 20px 0;
            overflow-x: auto;
            font-family: 'Courier New', monospace;
            font-size: 0.95rem;
            line-height: 1.5;
        }
        
        .tag {
            color: #e74c3c;
        }
        
        .attr {
            color: #3498db;
        }
        
        .value {
            color: #2ecc71;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            main {
                flex-direction: column;
                padding: 20px;
            }
            
            h1 {
                font-size: 2.2rem;
            }
            
            .nav-container {
                flex-direction: column;
                align-items: center;
            }
            
            nav a {
                margin: 5px 0;
                width: 200px;
                text-align: center;
            }
            
            .footer-content {
                flex-direction: column;
                text-align: center;
            }
        }
        
        /* 语义标签高亮 */
        .semantic-highlight {
            background: #e8f4fc;
            padding: 15px;
            border-radius: 5px;
            margin: 15px 0;
            border-left: 3px solid #3498db;
        }
        
        .tag-name {
            color: #e74c3c;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 页面头部 -->
        <header>
            <h1>HTML5语义标签应用</h1>
            <p class="subtitle">构建更具结构和可访问性的网页</p>
        </header>
        
        <!-- 主导航 -->
        <nav>
            <div class="nav-container">
                <a href="#home">首页</a>
                <a href="#about">关于我们</a>
                <a href="#services">服务项目</a>
                <a href="#blog">技术博客</a>
                <a href="#contact">联系我们</a>
            </div>
        </nav>
        
        <!-- 主要内容 -->
        <main>
            <!-- 主要文章内容 -->
            <article>
                <section id="introduction">
                    <h2>HTML5语义化标签介绍</h2>
                    <p>HTML5引入了一系列语义化标签，这些标签不仅定义了内容的结构，还描述了内容的含义。与传统的div标签相比，语义化标签让代码更易读、更易维护，同时提升了网站的可访问性和SEO效果。</p>
                    
                    <div class="semantic-highlight">
                        <strong>作用：</strong> <span class="tag-name">&lt;article&gt;</span> 定义独立的自包含内容，如博客文章、新闻故事等。
                    </div>
                </section>
                
                <section id="benefits">
                    <h3>语义化标签的优势</h3>
                    <ul>
                        <li><strong>更好的可访问性：</strong>屏幕阅读器能够更好地理解页面结构</li>
                        <li><strong>改进的SEO：</strong>搜索引擎更容易理解页面内容的重要性</li>
                        <li><strong>代码可读性：</strong>开发者更容易理解代码结构</li>
                        <li><strong>维护性：</strong>更容易维护和更新网站</li>
                        <li><strong>未来兼容性：</strong>为未来的Web技术做好准备</li>
                    </ul>
                </section>
                
                <section id="examples">
                    <h3>主要语义标签示例</h3>
                    
                    <figure>
                        <div class="semantic-image">
                            HTML5语义化布局示意图
                        </div>
                        <figcaption>典型的HTML5语义化页面布局结构</figcaption>
                    </figure>
                    
                    <h4>文章内容示例</h4>
                    <p>这是一篇关于Web开发技术的文章，使用<strong>&lt;article&gt;</strong>标签包裹，表示这是一个独立的内容块。</p>
                    
                    <h4>章节示例</h4>
                    <p>当前内容使用<strong>&lt;section&gt;</strong>标签组织，表示文档中的一个主题分组。</p>
                </section>
                
                <section id="code-example">
                    <h3>HTML5语义化结构代码</h3>
                    <div class="code-block">
                        <span class="tag">&lt;!DOCTYPE html&gt;</span><br>
                        <span class="tag">&lt;html</span> <span class="attr">lang=</span><span class="value">"zh-CN"</span><span class="tag">&gt;</span><br>
                        <span class="tag">&lt;head&gt;</span><br>
                        &nbsp;&nbsp;<span class="tag">&lt;meta</span> <span class="attr">charset=</span><span class="value">"UTF-8"</span><span class="tag">&gt;</span><br>
                        &nbsp;&nbsp;<span class="tag">&lt;title&gt;</span>页面标题<span class="tag">&lt;/title&gt;</span><br>
                        <span class="tag">&lt;/head&gt;</span><br>
                        <span class="tag">&lt;body&gt;</span><br>
                        &nbsp;&nbsp;<span class="tag">&lt;header&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;h1&gt;</span>网站标题<span class="tag">&lt;/h1&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;nav&gt;</span>导航菜单<span class="tag">&lt;/nav&gt;</span><br>
                        &nbsp;&nbsp;<span class="tag">&lt;/header&gt;</span><br><br>
                        
                        &nbsp;&nbsp;<span class="tag">&lt;main&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;article&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;section&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文章内容...<br>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;/section&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;/article&gt;</span><br><br>
                        
                        &nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;aside&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;侧边栏内容...<br>
                        &nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">&lt;/aside&gt;</span><br>
                        &nbsp;&nbsp;<span class="tag">&lt;/main&gt;</span><br><br>
                        
                        &nbsp;&nbsp;<span class="tag">&lt;footer&gt;</span><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;页脚内容...<br>
                        &nbsp;&nbsp;<span class="tag">&lt;/footer&gt;</span><br>
                        <span class="tag">&lt;/body&gt;</span><br>
                        <span class="tag">&lt;/html&gt;</span>
                    </div>
                </section>
            </article>
            
            <!-- 侧边栏 -->
            <aside>
                <div class="sidebar-widget">
                    <h3>关于作者</h3>
                    <p>前端开发工程师，专注于现代Web技术和用户体验设计。</p>
                </div>
                
                <div class="sidebar-widget">
                    <h3>热门文章</h3>
                    <ul>
                        <li>CSS Grid布局完全指南</li>
                        <li>JavaScript ES6+新特性</li>
                        <li>响应式设计最佳实践</li>
                        <li>Web性能优化技巧</li>
                    </ul>
                </div>
                
                <div class="sidebar-widget">
                    <h3>标签云</h3>
                    <p>
                        <span style="background:#3498db; color:white; padding:5px 10px; margin:2px; display:inline-block; border-radius:3px;">HTML5</span>
                        <span style="background:#e74c3c; color:white; padding:5px 10px; margin:2px; display:inline-block; border-radius:3px;">CSS3</span>
                        <span style="background:#2ecc71; color:white; padding:5px 10px; margin:2px; display:inline-block; border-radius:3px;">JavaScript</span>
                        <span style="background:#9b59b6; color:white; padding:5px 10px; margin:2px; display:inline-block; border-radius:3px;">响应式</span>
                    </p>
                </div>
                
                <div class="semantic-highlight">
                    <strong>作用：</strong> <span class="tag-name">&lt;aside&gt;</span> 定义与主要内容相关但不是主要内容的部分，如侧边栏、广告等。
                </div>
            </aside>
        </main>
        
        <!-- 页面页脚 -->
        <footer>
            <div class="footer-content">
                <div class="footer-section">
                    <h3>联系我们</h3>
                    <p>邮箱: contact@example.com</p>
                    <p>电话: 123-456-7890</p>
                </div>
                
                <div class="footer-section">
                    <h3>快速链接</h3>
                    <p><a href="#privacy" style="color:#3498db;">隐私政策</a></p>
                    <p><a href="#terms" style="color:#3498db;">服务条款</a></p>
                </div>
                
                <div class="footer-section">
                    <h3>关注我们</h3>
                    <p>微信公众号: ExampleTech</p>
                    <p>微博: @Example技术</p>
                </div>
            </div>
            
            <div class="footer-bottom">
                <p>&copy; 2023 HTML5语义标签应用示例. 保留所有权利.</p>
                <div class="semantic-highlight" style="margin-top:15px;">
                    <strong>作用：</strong> <span class="tag-name">&lt;footer&gt;</span> 定义文档或章节的页脚，通常包含版权信息、联系方式等。
                </div>
            </div>
        </footer>
    </div>
</body>
</html>